<!--
 * @Author: your name
 * @Date: 2019-12-16 11:40:26
 * @LastEditTime: 2020-08-10 16:15:56
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /mimall/src/pages/home.vue
 -->
<template>
  <div>
    <nav-header :slider='homeData.modelts' :menu="homeData.catalogs"></nav-header>
    <router-view />
    <nav-footer :companyInfo='homeData.sysContact'></nav-footer>
  </div>
</template>

<script>
import NavHeader from '../components/NavHeader'
import NavFooter from '../components/NavFooter'

export default {
  name: 'home',
  components: {
    NavHeader,
    NavFooter
  },
  data() {
    return {
      homeData: {},
      companyInfo: {},
      slider: [],
      menu: []
    }
  },
  mounted() {
    this.init()
  },
  methods: {
    init() {
      this.axios.post('/home').then(res => {
        /* eslint-disable */
        this.homeData = res.data
        window.localStorage.setItem('homeData', JSON.stringify(res.data) || {})
      })
    }
  }
}
</script>